cmake_minimum_required(VERSION 3.28)
project(gtk_demo C)

find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK4 REQUIRED gtk4)

set(CMAKE_C_STANDARD 11)
add_executable(gtk_demo main.c)

# 链接 GTK 4 库
target_include_directories(${PROJECT_NAME} PRIVATE ${GTK4_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${GTK4_LIBRARIES})
target_compile_options(${PROJECT_NAME} PRIVATE ${GTK4_CFLAGS_OTHER})